package com.study.spmongodb.wwj.guaua;

import com.google.common.base.Stopwatch;

import java.util.concurrent.TimeUnit;

/**
 * @author MI
 * @version 1.0
 * @date 2020/12/14 22:15
 */
public class StopWatchExample {
    public static void main(String[] args) throws InterruptedException {
        process("12");
    }

    /**
     * 耗费时间
     */
    private static void process(String orderNo) throws InterruptedException {
        System.out.println("-================" + orderNo);
        final Stopwatch started = Stopwatch.createStarted();
        TimeUnit.SECONDS.sleep(1);
        System.out.println("process success elpased" + orderNo + " " + (started.stop().elapsed(TimeUnit.SECONDS)));
    }
}
